package com.smartao.base.role;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.smartao.core.dao.BaseDao;
import com.smartao.core.service.BaseEntityService;

@Service
public class RoleServiceImpl extends BaseEntityService<Role, Long> implements RoleService{
	
	@Autowired
	private RoleDao roleDao;
	
	@Override
	protected BaseDao<Role, Long> getDao() {
		return roleDao;
	}
	
	@Override
	public Role findByRoleKey(String roleKey) {
		return roleDao.findByRoleKey(roleKey);
	}

	@Override
	public List<Role> findByRoleType(Long roleTypeId) {
		return roleDao.findByRoleType(roleTypeId);
	}
	
	@Override
	public Role findRoleAndUser(Long roleId){
		return roleDao.findRoleAndUser(roleId);
	}

	@Override
	public void addUserToRole(Long roleId, Long[] employeeIds) {
		roleDao.addUserToRole(roleId, employeeIds);
	}

}
